using System;
using System.Collections.Generic;
using System.Web.Profile;

namespace BlogEngine.Core
{
	/// <summary>
	/// 
	/// </summary>
	public class UserProfile : ProfileBase
	{
		/// <summary>
		/// Gets or sets the users first name.
		/// </summary>
		/// <value>The first name.</value>
		public string FirstName
		{
			get { return base["FirstName"] as string; }
			set { base["FirstName"] = value; }
		}

		/// <summary>
		/// Gets or sets the users last name.
		/// </summary>
		/// <value>The last name.</value>
		public string LastName
		{
			get { return base["LastName"] as string; }
			set { base["LastName"] = value; }
		}

		/// <summary>
		/// Gets or sets the how to display the users name.
		/// </summary>
		/// <value>The display as.</value>
		public string DisplayAs
		{
			get { return base["DisplayAs"] as string; }
			set { base["DisplayAs"] = value; }
		}

		/// <summary>
		/// Gets or sets the website.
		/// </summary>
		/// <value>The website.</value>
		public Uri Website
		{
			get
			{
				string website = base["Website"] as string;
				if (!String.IsNullOrEmpty(website))
					return new Uri(website);
				return null;
			}
			set
			{
				if (value == null)
					base["Website"] = null;
				else
					base["Website"] = value.OriginalString;
			}
		}

		/// <summary>
		/// Gets or sets the about.
		/// </summary>
		/// <value>The about.</value>
		public string About
		{
			get { return base["About"] as string; }
			set { base["About"] = value; }
		}
	}
}
